<?php

/*
	This file is part of Mandragon.

    Mandragon is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Mandragon is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Mandragon.  If not, see <http://www.gnu.org/licenses/>.
*/

include_once("sys/interfaces.inc");

class LoginPage implements iPageOutline {
	/**
	 * adds extra access checks, dependent on page state
	 */
	function page_inc_check_access($page) { }

	function page_inc_execute_action() { }
	//TODO: check for removal

	/**
	 * execute page logic
	 */
	function page_inc_execute($page) {
		$creator = new FormCreator();
		$inputs = array();
		$inputs[] = $creator->info("<a href=\".resetpassword\">Wachtwoord vergeten?</a><br/><a href=\".register?action=add\">Nog niet geregistreerd?</a>");
		$inputs[] = $creator->input_field("Wachtwoord", "password", '', 20, 20, "", 0, 1);
		$inputs[] = $creator->input_field("Gebruikersnaam", "login");
		$inputs[] = $creator->header("Vul je gebruikersgegevens in");
		$page->content['form'] = $creator->create('loginform', $inputs, "{$page->dir_path}?action=login");
		$page->content['body'] = "";
		$page->content['title'] = "Inloggen";
	}

	/**
	 * dress up page content using skin stuff
	 */
	function page_inc_dress($page) {
		print_form($page, $page->content['form']);
		print_body($page);
	}
}

?>